package com.sskj.hangqing.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.hangqing.http.HttpConfig;
import com.sskj.hangqing.ui.fragment.SpecialCoinFragment;
import com.sskj.lib.bean.CoinBean;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;


public class SpecialCoinFragmentPresenter extends BasePresenter<SpecialCoinFragment> {

    public void getData() {
        httpService.getSpecialProduct(null)
                .execute(new JsonCallBack<HttpData<List<CoinBean>>>() {
                    @Override
                    public void onSuccess(Response<HttpData<List<CoinBean>>> response) {
                        HttpData<List<CoinBean>> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {

                            mView.updateCoin(httpData.getData());
                        }
                    }

                });
    }
}
